﻿using System;
using GeoAPI.Geometries;

namespace YJKGridTopologyCal.Operation.Distance
{
	public class GeometryLocation
	{
		public GeometryLocation(IGeometry component, int segIndex, Coordinate pt)
		{
			this._component = component;
			this._segIndex = segIndex;
			this._pt = pt;
		}

		public GeometryLocation(IGeometry component, Coordinate pt) : this(component, -1, pt)
		{
		}

		public IGeometry GeometryComponent
		{
			get
			{
				return this._component;
			}
		}

		public int SegmentIndex
		{
			get
			{
				return this._segIndex;
			}
		}

		public Coordinate Coordinate
		{
			get
			{
				return this._pt;
			}
		}

		public bool IsInsideArea
		{
			get
			{
				return this._segIndex == -1;
			}
		}

		public const int InsideArea = -1;

		private readonly IGeometry _component;

		private readonly int _segIndex;

		private readonly Coordinate _pt;
	}
}
